{% extends 'mathtesthome.html' %}
{% block body %}
<div class="main-content container">


    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default">
                {{exist}}

                <a href="{%url 'mathtest:examupdate' test.id%}">update</a>

                <div class="panel-heading panel-heading-divider">{{title}}<span
                        class="panel-subtitle"></span>
                    <div class="col-lg-6">
                        <p class="text-right">
                            {{test.name}}
                        </p>
                    </div>
                    <div class="panel-body pl-sm-5">
                        <form method='POST' action="{% url 'mathtest:OUtestscore' test.id %}"
                              enctype='multipart/form-data'>
                            {% csrf_token %}


                            <div class="panel-heading panel-heading-divider">- 选择题</div>
                            {% for q in test.questions.getChooseQuesitons %}


                            <div class="form-group row">
                                <label class="col-4 col-form-label text-sm-right">{{q}}</label>

                                <div class="col-4 form-check mt-2">
                                    {%for a in q.answer_set.all %}
                                    <label class="custom-control custom-radio custom-control-inline">
                                        <input type="radio" name="{{q.id}}"
                                               class="custom-control-input" value="{{a.id}}" required> <span
                                            class="custom-control-label">{{a}}</span>
                                    </label>
                                    {%endfor%}
                                    <label class="col-12 col-sm-3 col-form-label">


                                    </label>

                                </div>
                                <div class="col-3 form-check mt-2">
                                           <blockquote>
                                            <footer><a class="comment-reply-btn" href="#">答案</a></footer>
                                            <div class="comment-reply" style="display: none;">
                                            <a href="#">{{ q.get_markdown|truncatechars_html:120 }}</a>
                                            </div>
                                        </blockquote>

                                </div>
                                <div class="col-1 form-check mt-2">

                                <label>
                                    <a href="{%url 'mathtest:mistakeupdate' q.id%}">更新</a>
                                </label>
                                </div>

                            </div>

                            {%endfor%}
                            <div class="panel-heading panel-heading-divider">- 填空题</div>
                            {% for q in test.questions.getFillQuesitons %}


                            <div class="form-group row">
                                <div  class="col-2 form-check mt-2"></div>
                                <label class="col-4 col-form-label">{{q}}</label>


                                <div class="col-3 form-check mt-2">
                                           <blockquote>
                                            <footer><a class="comment-reply-btn" href="#">答案</a></footer>
                                            <div class="col-1 comment-reply" style="display: none;">
                                            <a href="#">{{ q.get_markdown|truncatechars_html:120 }}</a>
                                            </div>
                                        </blockquote>

                                </div>
                                <div class="col-1 form-check mt-2">

                                <label>
                                    <a href="{%url 'mathtest:mistakeupdate' q.id%}">更新</a>
                                </label>
                                </div>

                            </div>

                            {%endfor%}

                            <div class="panel-heading panel-heading-divider">- 解答题</div>
                            {% for q in test.questions.getResolveQuesitons %}


                            <div class="form-group row">

                               <div  class="col-2 form-check mt-2"></div>
                                <label class="col-4 col-form-label">{{q}}</label>


                                      <div class="col-3 form-check mt-2">
                                           <blockquote>
                                            <footer><a class="comment-reply-btn" href="#">答案</a></footer>
                                            <div class="col-1 comment-reply" style="display: none;">
                                            <a href="#">{{ q.get_markdown|truncatechars_html:120 }}</a>
                                            </div>
                                        </blockquote>

                                </div>
                                <div class="col-1 form-check mt-2">

                                <label>
                                    <a href="{%url 'mathtest:mistakeupdate' q.id%}">更新</a>
                                </label>
                                </div>

                            </div>

                            {%endfor%}


                        </form>
                    </div>

                </div>
            </div>
        </div>
    </div>

    {% endblock %}
    {% block extendscript%}
    <script>
        $(".comment-reply-btn").click(function(event){
        event.preventDefault();
        $(this).parent().next(".comment-reply").fadeToggle();
    })

    </script>
    {% endblock %}